<html>
<body>
<p id="p1">Find the location of "Hello"?</p>
<p id="p2"></p>
<button onclick="myFunction()">ClickMe</button>

<script>
	function myFunction()
	{
		var x;
		x=document.getElementById("p1").innerHTML;
		var y=x.indexOf("Hello");
		document.getElementById("p2").innerHTML=y+1;
	}

</script>
</body>
</html>